import time
from concurrent.futures.process import ProcessPoolExecutor


def func(value):
    time.sleep(1)
    print(value, end='\t\n')


if __name__ == '__main__':  # 需要加，否则会报错

    pool = ProcessPoolExecutor(max_workers=5)
    for i in range(10):
        fut = pool.submit(func, i)
        print(fut)
